package com.rx.mgt.util;

import org.apache.commons.codec.binary.Base64;

import java.util.UUID;

/**
 * Created by zxj on 2017/4/11.
 */
public class StringUtil {

    public static String UUID(){
        UUID uuid = UUID.randomUUID();
        return uuid.toString().replaceAll("-","");
    }

    public static byte[] encodeBase64(String str){


        return Base64.encodeBase64(str.getBytes());
    }

    public static String decodeBase64(String str){
        String s="";
        byte[] bytes = Base64.decodeBase64(str);
        s =new String(bytes);
        return s;
    }

}
